package com.newmainsoftech.dao.entity.relation;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.util.Collection;

public interface BiLinkCollectionProxy<R extends HolderSide<E>, E extends HoldeeSide<R>> 
extends InvocationHandler {
//TODO shall I implement bypassProxy switch?
	
	/**
	 * To handle invocation of <code>iterator()</code> method of <code>Collection</code> 
	 * interface.<br /> 
	 * 
	 * @return
	 */
	Object interIterator( Object proxy, Method method);
	
	/**
	 * To handle invocation of <code>add</code> method of <code>Collection</code> 
	 * interface.<br /> 
	 * 
	 * @param proxy
	 * @param method
	 * @param holdeeArg
	 * @return
	 */
	Object interAdd( Object proxy, Method method, E holdeeArg);
	/**
	 * To handle invocation of <code>remove</code> method of <code>Collection</code> 
	 * interface.<br /> 
	 * 
	 * @param proxy
	 * @param method
	 * @param holdeeArg
	 * @return
	 */
	Object interRemove( Object proxy, Method method, E holdeeArg);
	
	/**
	 * To handle invocation of <code>addAll</code> method of <code>Collection</code> 
	 * interface.<br /> 
	 * 
	 * @param proxy
	 * @param method
	 * @param holdeeBunch
	 * @return
	 */
	Object interAddAll( Object proxy, Method method, Collection<E> holdeeBunch);	

	/**
	 * To handle invocation of <code>removeAll</code> method of <code>Collection</code> 
	 * interface.<br /> 
	 * 
	 * @param proxy
	 * @param method
	 * @param holdeeBunch
	 * @return
	 */
	Object interRemoveAll( Object proxy, Method method, Collection<E> holdeeBunch);	

	/**
	 * To handle invocation of <code>retainAll</code> method of <code>Collection</code> 
	 * interface.<br /> 
	 * 
	 * @param proxy
	 * @param method
	 * @param holdeeBunch
	 * @return
	 */
	Object interRetainAll( Object proxy, Method method, Collection<E> holdeeBunch);	
}